<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="teacher/_TFragment :: head(~{::title})">
    <meta charset="UTF-8">
    <title>主页</title>
    <link rel="stylesheet" href="../../static/layui/css/layui.css">
    <link rel="stylesheet" href="../../static/css/main.css">
    <script src="../../static/layui/layui.js"></script>
</head>
<body>
    <!--头部导航部分-->
    <div class="header" th:replace="teacher/_TFragment :: topmenu">
        <div class="layui-col-md10">
            <span id="header-font">贫困生资助系统</span>
        </div>
        <ul class="layui-nav layui-col-md2">
            <li class="layui-nav-item" style="float: right">
                <a href=""><img src="//t.cn/RCzsdCq" class="layui-nav-img">我</a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:;">修改信息</a></dd>
                    <dd><a href="javascript:;">安全管理</a></dd>
                    <dd><a href="javascript:;">退了</a></dd>
                </dl>
            </li>
        </ul>
    </div>
    <!--主要内容部分-->
    <div class="layui-row">
        <!--左侧导航-->
        <ul th:replace="teacher/_TFragment :: leftmenu(1)" class="layui-nav layui-nav-tree  layui-col-md2" lay-filter="demo" style="height: 662px">
            <li class="layui-nav-item layui-nav-itemed">
                <a href="javascript:;"><i class="layui-icon">&#xe770;</i> 个人中心</a>
                <dl class="layui-nav-child">
                    <dd class="layui-this"><a href="javascript:;">主页</a></dd>
                    <dd><a href="javascript:;">用户信息</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item"><a href="#"><i class="layui-icon">&#xe66f;</i> 学生信息</a></li>
            <li class="layui-nav-item">
                <a href="javascript:;"><i class="layui-icon">&#xe6b2;</i> 经济困难认定</a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:;">经济困难认定</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;"><i class="layui-icon">&#xe857;</i> 资助管理</a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:;">资源管理</a></dd>
                    <dd><a href="javascript:;">资助申请审核</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;"><i class="layui-icon">&#xe631;</i> 系统管理</a>
                <dl class="layui-nav-child">
                    <dd><a href="javascript:;">修改密码</a></dd>
                </dl>
            </li>
        </ul>
        <!--右侧内容-->
        <div class="layui-col-md10">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                <legend>主页</legend>
            </fieldset>
            <!--主页内容-->
            <div class="layui-row layui-container">
                <div class="layui-col-md6" id="echars1" style="width: 500px;height:400px;"></div>
                <div class="layui-col-md6" id="echars2" style="width: 500px;height:400px;"></div>
            </div>
        </div>
    </div>
</body>
<script src="../../static/js/echarts.js" th:src="@{/js/echarts.js}"></script>
<script>
    layui.use('element', function(){
    });
    layui.use('form', function(){
    });
    layui.use('jquery',function () {
        var $ = layui.$;
        //echars1
        var myChart1 = echarts.init(document.getElementById('echars1'));
        $.get({
            url:'/teacher/specialList',
            success:function (data) {
                myChart1.setOption({
                    title: {
                        text: '各类特殊条件人数'
                    },
                    tooltip: {},
                    legend: {
                        data: ['人数']
                    },
                    xAxis: {
                        data: ["孤残", "单亲", "烈士子女", "优抚对象", "低保家庭"]
                    },
                    yAxis: {},
                    series: [{
                        name: '人数',
                        type: 'bar',
                        data: data
                    }]
                });
            }
        });
        //echars2
        var myChart2 = echarts.init(document.getElementById('echars2'));
        $.get({
            url:'/teacher/echarsDataList',
            success:function (data) {
                myChart2.setOption({
                    title: {
                        text: '各类资助资源情况'
                    },
                    series: [ {
                        name: '访问来源',
                        type: 'pie',
                        radius: '55%',
                        roseType: 'angle',
                        data: data
                    }]
                });
            }
        });
    });
</script>
</html>